package com.tbit.uqbike.object.pojo.vo;

import cn.hutool.core.date.DateUtil;
import com.tbit.uqbike.constant.CsvConstant;
import com.tbit.uqbike.webmanager.util.csv.annotations.Csv;
import com.tbit.uqbike.webmanager.util.csv.annotations.Sum;
import lombok.Data;

import java.util.Date;

/**
 * 用户流水记录
 *
 * @Author:BUGTian
 * @DATE: 2022/11/19
 */
@Data
public class UserFundsFlowVO {

    @Csv(name = "时间", type = CsvConstant.CSV_TYPE_WITHOUT)
    private String changeTimeStr;
    /**
     * 主键id
     */
    private Long userCapitalChangeId;
    /**
     * 用户id
     */
    private Integer userId;
    /**
     * 用户手机号
     */
    @Csv(name = "手机号", type = CsvConstant.CSV_TYPE_WITHOUT)
    private String phone;
    /**
     * 用户姓名
     */
    private String userName;
    /**
     * 变动区域id
     */
    private Integer accountId;
    /**
     * 品牌id
     */
    private Integer brandId;
    /**
     * 变动金额
     */
    @Sum
    @Csv(name = "金额", type = CsvConstant.CSV_TYPE_WITHOUT)
    private Double changeMoney;
    /**
     * 收支类型1：充值，2：消费
     */
    @Csv(name = "收支类型", keys = {"1", "2"}, values = {"充值", "消费"}, type = CsvConstant.CSV_TYPE_WITHOUT)
    private Integer changeType;
    /**
     * 业务类型1：余额，2：押金，3：礼品卡，4：购卡订单，5：骑行订单直付
     */
    @Csv(name = "业务类型", keys = {"1", "2", "3", "4", "5"}, values = {"余额", "押金", "礼品卡", "购卡订单", "骑行订单直付"}, type = CsvConstant.CSV_TYPE_WITHOUT)
    private Integer capitalType;
    /**
     * 子业务类型 业务类型 1：用户充余额 2：用户退余额 3：人工充余额 4：人工扣余额 5：骑行消费余额 6：充值结束订单 7：欠款补交 8：骑行退款 9：用户充押金 10：用户退押金 11：人工充押金 12：人工扣押金 13：充值赠送礼品卡 14：退余额扣除礼品卡 15：礼品卡兑换 16：骑行消费礼品卡 17：人工充礼品卡 18：人工扣礼品卡 19：购买骑行卡 20：骑行卡退款 21：购买免押卡 22：免押卡退款 23：购买会员卡 24：会员卡退款 25：购买优惠券套餐 26：优惠券套餐退款
     */
    @Csv(name = "子业务类型", keys = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26"}, values = {"用户充余额", "用户退余额", "人工充余额", "人工扣余额", "骑行消费余额", "充值结束订单", "欠款补交", "骑行退款", "用户充押金", "用户退押金", "人工充押金", "人工扣押金", "充值赠送礼品卡", "退余额扣除礼品卡", "礼品卡兑换", "骑行消费礼品卡", "人工充礼品卡", "人工扣礼品卡", "购买骑行卡", "骑行卡退款", "购买免押卡", "免押卡退款", "购买会员卡", "会员卡退款", "购买优惠券套餐", "优惠券套餐退款"}, type = CsvConstant.CSV_TYPE_WITHOUT)
    private Integer businessType;
    /**
     * 详情（骑行订单号）
     */
    @Csv(name = "业务详情", type = CsvConstant.CSV_TYPE_WITHOUT)
    private String details;
    /**
     * 操作人id
     */
    private Integer operatorId;
    /**
     * 操作人手机号码
     */
    @Csv(name = "操作人手机号", type = CsvConstant.CSV_TYPE_WITHOUT)
    private String operatorPhone;
    /**
     * 操作人名称
     */
    @Csv(name = "操作人", type = CsvConstant.CSV_TYPE_WITHOUT)
    private String operatorName;
    /**
     * 业务订单号
     */
    @Csv(name = "业务订单号", type = CsvConstant.CSV_TYPE_WITHOUT)
    private String businessNO;
    /**
     * 商户订单号
     */
    @Csv(name = "商户订单号", type = CsvConstant.CSV_TYPE_WITHOUT)
    private String merchantNO;
    /**
     * 变动时间
     */
    private Long changeTime;
    /**
     * 备注
     */
    private String remark;
    /**
     * 原区域id
     */
    private Integer originalAccountId;

    public String getChangeTimeStr() {
        return DateUtil.format(new Date(this.changeTime), "yyyy-MM-dd HH:mm:ss");
    }
}
